package com.example.userservice.pojo;

import lombok.Data;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.validation.annotation.Validated;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import java.util.Date;
@Table(name = "tb_user")
@Data
public class User {
    @Id
    @KeySql(useGeneratedKeys = true)
    private Long id;
    @NotEmpty(message = "名称不能为空")
    private String userName; // 用户名
    private String password; // 密码
    @Min(value = 0,message = "最小值不能低于0")
    private String name;// 姓名
    private Integer age;// 年龄
    private Integer sex;// 性别，1男性，2女性
    private Date birthday;// 出生日期
    private Date created;// 创建时间
    private Date updated;// 更新时间
    private String note;// 备注
}
